#include<stdio.h>
int main()
{
    struct student
    {
        char number[6];
        char name[10];
        int score[3];
        int sum;
    };


    struct student stu[10];

    int n;
    scanf("%d", &n);
    int i = 0;
    for (i = 0; i < n; i++)
    {
        scanf("%s", stu[i].number);
        scanf("%s", stu[i].name);
        int j = 0;
        for (j = 0; j < 3; j++)
        {
            scanf("%d", &stu[i].score[j]);
        }
    }

    for (i = 0; i < n; i++)
    {
        stu[i].sum = 0;
        int j = 0;
        for (j = 0; j < 3; j++)
        {
            stu[i].sum += stu[i].score[j];
        }

    }

    int max = 0;
    for (i = 1; i < n; i++)
    {
        if (stu[max].sum < stu[i].sum)
        {
            max = i;
        }
    }

    printf("%s %s %d", stu[max].name, stu[max].number, stu[max].sum);

    return 0;

}